home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / System / ScreenDaemon 1.2 / ScreenDaemon cdev / Framework / TControlPanel.h < prev   
C/C++ Source or Header  |  1995-05-16  |  2KB  |  50 lines

  1. #pragma once
  2.  
  3. #ifndef    _H_TControlPanel
  4. #define    _H_TControlPanel
  5.  
  6. // Description:    A C++ class for writing control panel's (CDEV's)
  7. //                 in Metrowerks CodeWarrior.
  8. // Author:         Matthew E. Axsom
  9. // Version:     1.1.1 - 05/16/95
  10. // Copyright:    ©1994-95, Matthew E. Axsom, All Rights Reserved
  11.  
  12. // internal error code for cdevMemErr.  Use instead of cdevMemErr since cdevMemErr
  13. // is 0 and framework uses a return code of zero to indicate success.
  14. #define    cdevFWMemErr    memFullErr
  15.  
  16. class TControlPanel {
  17. public:
  18.     short        fLastItem;                // last system item in control panel.
  19.  
  20.     DialogPtr    fDialog;                // control panel dialog box
  21.     EventRecord    *fEvent;                // event
  22.     
  23.             TControlPanel(short numItems,DialogPtr cp);
  24.     virtual    ~TControlPanel(void);
  25.     
  26.     //  processes all events 'cept macDev,initDev,closeDev
  27.     long actions(short message, short itemHit);    
  28.     long CommandKey(short);                // handles command key's for non sys7 machines
  29.     
  30.     // you'll need to override these methods w/your own.
  31.     
  32.     // these 2 are provided to ease porting from Symantec's CDEV framework.
  33.     // Initilization and clean up should be done from constructor/destructor
  34.     virtual long Init(void);            // called as a result of a initDev message
  35.     virtual long Close(void);            // called as a result of a closeDev message
  36.     
  37.     virtual long ItemHit(short itemHit);    // handles a mouse hit in the control panel
  38.     virtual long Idle(void);            // handling of nulDev message
  39.     virtual long Update(void);            // update user items
  40.     virtual long Activate(void);        // activate user items
  41.     virtual long Deactivate(void);        // deactivate user items
  42.     virtual long KeyDown(short c);        // key down was pressed
  43.     virtual long Undo(void);            // undo from edit menu or cmd-z
  44.     virtual long Cut(void);                // cut from edit menu or cmd-x
  45.     virtual long Copy(void);            // copy from edit menu or cmd-c
  46.     virtual long Paste(void);            // paste from edit menu or cmd-v
  47.     virtual long Clear(void);            // clear from edit menu
  48. };
  49.  
  50. #endif    //_H_TControlPanel